<?php
	require_once dirname(__FILE__).'/../der-kalender/event.class.php';

	class EventTest extends UnitTestCase {
		public function testConstructorSetsPrivateVars() {
			$dateTime = new DateTime();
			$title = 'Testtitel';
			$description = 'Testbeschreibung';
			$pending = true;
			$event = new Event($dateTime, $title, $description, $pending);
			$this->assertEqual($dateTime, $event->getDateTime());
			$this->assertEqual($title, $event->getTitle());
			$this->assertEqual($description, $event->getDescription());
			$this->assertEqual($pending, $event->getPending());
		}

		public function testConstructorHasEmptyDefaultDescription() {
			$event = new Event(new DateTime(), '');
			$this->assertEqual('', $event->getDescription());
		}

		public function testConstructorHasFalseDefaultPending() {
			$event = new Event(new DateTime(), '');
			$this->assertEqual(false, $event->getDescription());
		}

		public function testCanSetAndGetTitle() {
			$event = new Event(new DateTime(), '');
			$expected = 'Testtitel';
			$event->setTitle($expected);
			$this->assertEqual($expected, $event->getTitle());
		}

		public function testCanSetAndGetDateTime() {
			$event = new Event(new DateTime(), '');
			$expected = new DateTime();
			$event->setDateTime($expected);
			$this->assertEqual($expected, $event->getDateTime());
		}

		public function testCanSetAndGetDescription() {
			$event = new Event(new DateTime(), '');
			$expected = 'Testbeschreibung';
			$event->setDescription($expected);
			$this->assertEqual($expected, $event->getDescription());
		}

		public function testCanSetAndGetPending() {
			$event = new Event(new DateTime(), '');
			$expected = true;
			$event->setPending($expected);
			$this->assertEqual($expected, $event->getPending());
		}
	}